package com.skt.TFriend.databases;

import java.io.File;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DatabaseHelper extends SQLiteOpenHelper {
	
	private static final String DATABASE_NAME = "TFriend.db";	
	private static final int DATABASE_VERSION = 1;
	
	//데이터베이스 존재여부....확인
	public static boolean isExistDB() {
		boolean result = false;
		File file = new File("/data/data/com.skt.TFriend/databases/"+DATABASE_NAME);
				
		if (file.exists()){
			result = true;
		} else {
			Log.d("DatabaseHelper", "DB does not exist!!!!!!");
		}
		return result;
	}
	
	public DatabaseHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		// 테이블 만드는 예시
//		String  createTable = "CREATE TABLE "+"테이블명"+" (" 
//			+ "컬럼명 INTEGER PRIMARY KEY AUTOINCREMENT, "
//			+ "컬럼명 TEXT, ";
//		db.execSQL(createTable);
		
//		createTable = "CREATE TABLE "+"테이블명1"+" (" 
//		+ "컬럼명 INTEGER PRIMARY KEY AUTOINCREMENT, "
//		+ "컬럼명 TEXT, ";
//		db.execSQL(createTable);
		
//		String createTable = "CREATE TABLE TC_SCHDL (" 
//		+ "SEQ_NO INTEGER PRIMARY KEY AUTOINCREMENT, "
//		+ "DAY TEXT, ";
//		db.execSQL(createTable);
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
	}

}
